home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 February: Tool Chest / Dev.CD Feb 99 TC.toast / What's New? / Development Kits / Mac OS USB v1.1f3 DDK / Examples / MouseModule / MouseModule.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-07  |  2.4 KB  |  86 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MouseModule.h
  3.  
  4.     Contains:    Header file for mouse module
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11. #ifndef __MouseModuleH__
  12. #define __MouseModuleH__
  13.  
  14. #include <Types.h>
  15. #include <Devices.h>
  16. #include <DriverServices.h>
  17. #include <Processes.h>
  18. #include <CursorDevices.h>
  19. #include <USB.h>
  20.  
  21. Boolean    immediateError(OSStatus err);
  22. void     InitParamBlock(USBReference theInterfaceRef, USBPB * paramblock);
  23. void     MouseInitiateTransaction(USBPB *pb);
  24. void     MouseCompletionProc(USBPB *pb);
  25. void    InterfaceEntry(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterfaceDescriptor, USBDeviceDescriptorPtr pDeviceDescriptor, USBDeviceRef device);
  26.  
  27. /*    Prototypes from MouseModuleHeader.c    Tue, Mar 17, 1998 3:30:22 PM    */
  28. static     OSStatus    MouseModuleInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
  29. static     OSStatus    MouseInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
  30. static     OSStatus    MouseModuleFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc);
  31.  
  32. /*    Prototypes from MouseConfigParse.c    Tue, Mar 17, 1998 3:17:14 PM    */
  33.  
  34. OSStatus USBHIDControlDevice(UInt32 theControlSelector, void * theControlData);
  35. void     NotifyRegisteredHIDUser(UInt32 devicetype, UInt8 hidReport[]);
  36.  
  37. void     USBMouseIn(UInt32 refcon, void * theData);
  38.  
  39. #define kMouseRetryCount    3
  40.  
  41. enum driverstages
  42. {  
  43.     kUndefined = 0,
  44.     kSetProtocol,
  45.     kSetIdleRequest,
  46.     kConfigureInterface,
  47.     kFindPipe,
  48.     kReadInterruptPipe,
  49.     kClearFeature,
  50.     kReturnFromDriver =     0x1000,
  51.     kRetryTransaction =     0x2000,
  52.     kSyncTransaction =         0x4000,
  53.     kCompletionPending =     0x8000
  54. };
  55.  
  56. typedef struct
  57. {
  58.     USBPB                             pb;
  59.     void (*handler)(USBPB             *pb);
  60.  
  61.     USBReference                    interfaceRef;
  62.     USBPipeRef                        pipeRef;
  63.     
  64.     USBDeviceDescriptor             deviceDescriptor;
  65.     USBInterfaceDescriptor            interfaceDescriptor;
  66.  
  67.     USBConfigurationDescriptorPtr     pFullConfigDescriptor;
  68.  
  69.     UInt32                            hidDeviceType;
  70.     UInt8                            hidReport[64];
  71.     UInt32                            maxPacketSize;
  72.     
  73.     HIDInterruptProcPtr             pSHIMInterruptRoutine;
  74.     HIDInterruptProcPtr             pSavedInterruptRoutine;
  75.     
  76.     UInt32                            interruptRefcon;
  77.     
  78.     SInt32                             retryCount;
  79.     SInt32                            transDepth;
  80.     
  81.     CursorDevicePtr                    pCursorDeviceInfo;
  82.     CursorDevice                    cursorDeviceInfo;
  83.     Fixed                            unitsPerInch;
  84. } usbMousePBStruct;
  85.  
  86. #endif //__MouseModuleH__